function [nrm] = dotProduct(u,v,normalize)
%Computes the dot product of u and v 
    
    %Must be of same length
    assert(size(v,1)==size(u,1));
    
    %Assuming column vectors
    assert(size(u,2)==size(v,2) && size(v,2)==1);
    
    nrm = u'*v;
    
    if (normalize)
        
        nrm = nrm/(norm(u)*norm(v));
   
    end
end
